package com.lancoo.cvas.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lancoo.cvas.entity.RuleCourseProhibit;
import com.lancoo.cvas.entity.RuleTeachingClassProhibit;
import com.lancoo.cvas.entity.TeachingClassTeacher;
import com.lancoo.cvas.mapper.RuleTeachingClassProhibitMapper;
import com.lancoo.cvas.pojo.common.Deleted;
import com.lancoo.cvas.service.RuleTeachingClassProhibitService;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("ruleTeachingClassProhibitService")
public class RuleTeachingClassProhibitServiceImpl extends ServiceImpl<RuleTeachingClassProhibitMapper, RuleTeachingClassProhibit> implements RuleTeachingClassProhibitService {


    /**
     * @Description: 获取教学班固排课时
     * @Author: liufeng
     * @Date: 2023/12/7 15:40
     * @param taskId:
     * @param teachingClassIds:
     * @return:
     */
    @Override
    public List<RuleTeachingClassProhibit> getTeachingClassFix(Integer taskId, List<Long> teachingClassIds) {
        return baseMapper.getFixByTeachingClassId(taskId,teachingClassIds,1, Deleted.NOT.getCode());
    }


    /**
     * @Description: 根据教学班id和hourType获取教学班固排课时
     * @Author: liufeng
     * @Date: 2024/2/22 11:27
     * @param taskId:
     * @param list:
     * @return:
     */
    @Override
    public List<RuleTeachingClassProhibit> getTeachingClassFixByTeachingClassAndType(Integer taskId, List<TeachingClassTeacher> list) {
        return baseMapper.getTeachingClassFixByTeachingClassAndType(taskId,list,1, Deleted.NOT.getCode());
    }

    @Override
    public List<RuleTeachingClassProhibit> getTeachingClassTypeFix(Integer taskId, Long teachingClassId, Integer hourType) {
        return baseMapper.getFixByTeachingClassHourType(taskId,teachingClassId,hourType,1, Deleted.NOT.getCode());
    }

    /**
     * @Description: 保存课程固排到教学班固排表
     * @Author: liufeng
     * @Date: 2023/12/11 19:11
     * @param taskId:
     * @param teachingClassIds:
     * @param ruleCourseProhibit:
     * @return:
     */
    @Override
    public boolean saveCourseFix(Integer taskId, List<Long> teachingClassIds, RuleCourseProhibit ruleCourseProhibit, Integer type,Long courseId) {
        return baseMapper.saveCourseFix(taskId,teachingClassIds,ruleCourseProhibit,type,courseId);
    }

    @Override
    public void saveCourseFixByTeachingClass(Integer taskId, Long teachingClassId, List<RuleCourseProhibit> fixList, int type, int hourType, Long courseId) {
        baseMapper.saveCourseFixByTeachingClass(taskId,teachingClassId,fixList,type,hourType,courseId);
    }
}